import time

import gevent
import requests
from gevent import monkey

monkey.patch_all()

url_list = ['http://www.baidu.com'] * 5


def request_url(url):
    response = requests.get(url)
    print(response)


start_time = time.time()
jobs = [gevent.spawn(request_url, url) for url in url_list]
gevent.joinall(jobs)
print(time.time() - start_time)
